<!DOCTYPE html>
<html lang="zh-CN">
  <head>
   <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <title>CloudBooking User login</title>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="js/common.js"></script>
  </head>
  <body>
    <h1>Group</h1>
   <script>
    var ApiHref=""   
    function login() {
        if($("#account").val()==""){
            alert("user name is requied.");
            return;
        }
        if($("#password").val()==""){
            alert("password name is requied.");
            return;
        }
        
        var JsonData = {};
        JsonData.accout = $("#account").val();
        JsonData.password = $("#password").val();
        var url = ApiHref + "/api/login";        
        $.post(url, JsonData, function (res) {
            console.log(res);
          if(res.status=="1"){
              SetLocalStorage("loginData",JSON.stringify(res.metadata));
              window.location=GetPathName()+"index";
          }          
          else{
              alert(res.msg);
          }
        },"json");
    }
</script>
  </body>
</html>